package com.example.yunifang.adapter;

import java.util.ArrayList;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.yunifang.R;
import com.example.yunifang.bean.XiangQingBean.Data.Goods.Attributes;
public class CanShuAdpater extends BaseAdapter {

	ArrayList<Attributes> data;
	Context context;
	
	public CanShuAdpater(ArrayList<Attributes> data, Context context) {
		super();
		this.data = data;
		this.context = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return data.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return data.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		View view=View.inflate(context, R.layout.canshu_list_item, null);
		TextView title=(TextView) view.findViewById(R.id.canshu_title);
		TextView name=(TextView) view.findViewById(R.id.canshu_name);
		title.setText(data.get(position).attr_name);
		name.setText(data.get(position).attr_value);
		return view;
	}

}
